import { handleActions } from "redux-actions";
import { GET_ALL_COMMS } from "../types.js";
import _ from "lodash";

// 初始化数据
const InitData = [
    {
        name: "",
        price: 1,
        count: 1,
        desc: "",
        image: [],
        isAttend: false,
        childId: "",
        parentId: "",
        childType:"",
        poster:[]
    }
]


export const allComms = handleActions({
    // 获取所有类型
    [GET_ALL_COMMS]: (state, { payload }) => {
        const { data } = payload;
        return _.assign([], state, data)
    },
}, InitData)